﻿/**单元素向上移动*/
function mUp(sid) {
    var selectRight = document.getElementById(sid);
    var i = selectRight.options.selectedIndex;
    var j = i - 1;
    if (i > 0) {
       var Temp_Text = selectRight.options[j].text;
       var Temp_ID = selectRight.options[j].value;

        selectRight.options[j].text = selectRight.options[i].text;
        selectRight.options[j].value = selectRight.options[i].value;

        selectRight.options[i].text = Temp_Text;
        selectRight.options[i].value = Temp_ID;

        selectRight.selectedIndex = j;
    }
}
/**单元素向下移动*/
function mDown(sid) {
    var selectRight = document.getElementById(sid);
    var i = selectRight.options.selectedIndex;
    if (i != selectRight.length - 1) {
        var j = i + 1;
        if (i < selectRight.length) {
            var Temp_Text = selectRight.options[j].text;
            var Temp_ID = selectRight.options[j].value;

            selectRight.options[j].text = selectRight.options[i].text;
            selectRight.options[j].value = selectRight.options[i].value;

            selectRight.options[i].text = Temp_Text;
            selectRight.options[i].value = Temp_ID;

            selectRight.selectedIndex = j;
        }
    }
}

function RemoveDetail(sid) { 
    var t = $("#" + sid).find("option:selected").text();
    var v = $("#" + sid).val();
    alert(t);
    alert(v);
    if (!isNull(t) && !isNull(v)) {
        if ($("#" + sid + " option[value=" + v + "]").length > 0) {
            $("#" + sid + " option:selected").remove();
        }
        else {
            $("#" + sid + " option:selected").remove();
        }

    }
    else {
        alert("请从左侧列表中选择企业后再移除");
    }
}   